﻿(function () {
    'use strict';
    // Uncomment the following line to enable first chance exceptions.
    // Debug.enableFirstChanceException(true);

    var i = 0;
        
    var bgColors = [ '#ffffff', '#999999', '#222222' ];
        
    WinJS.Application.onmainwindowactivated = function (e) {
        if (e.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
            $('#mainBody').click(function() {
                i = (i + 1) % 3;
                var bgColor = bgColors[i];
                $('#mainBody').css('background-color', bgColor);
            });
        }
    }

    WinJS.Application.start();
})();